
//更多按钮
let moreBtn = document.querySelector('.sl_ext_show');
moreBtn.addEventListener('click', function () {
  let select = this.parentNode.parentNode;

  let ul = select.querySelector('ul');

  if (ul.className.includes('nomore')) {
    // console.log(this.firstChild)
    this.firstChild.textContent = "收起";
    this.firstElementChild.style.backgroundPositionY = "-28px";
  } else {
    this.firstChild.textContent = "更多";
    this.firstElementChild.style.backgroundPositionY = "7px";
  }
  select.classList.toggle('extend');
  ul.classList.toggle('nomore');
  ul.classList.toggle('more');
})


let moreCheckBtn = document.querySelector('.moreCheck');
moreCheckBtn.addEventListener('click', function () {
  let select = this.parentNode.parentNode;

  let ul = select.querySelector('ul');
  let selectBtn = select.querySelector('.sl_ext');
  let btn = select.querySelector('.sl_ext_show');


  btn.firstChild.textContent = "更多";
  btn.firstElementChild.style.backgroundPositionY = "7px";
  ul.classList.add('nomore');
  ul.classList.remove('more');
  select.classList.add('extend');
  ul.classList.add('checkbox');
  selectBtn.classList.add('hide');
})

let cancelBtn = document.querySelector('.cancel');
cancelBtn.addEventListener('click', function () {
  let select = this.parentNode.parentNode.parentNode;
  let moreBtn = select.querySelector('.sl_ext');
  let ul = select.querySelector('ul');

  select.classList.remove('extend');
  ul.classList.toggle('checkbox');
  moreBtn.classList.toggle('hide');
})